home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / WD_SRC.ZIP / BSP_GEN / BSP_GEN.HPP < prev    next >
C/C++ Source or Header  |  1995-01-05  |  2KB  |  50 lines

  1. #include <ctype.h>
  2. #include <conio.h>
  3.  
  4. #include "..\Bsp_Gen\io.hpp"
  5.  
  6.  
  7. #define DIFF(x,y)   ( (x)>(y) ? (x)-(y) : (y)-(x) )
  8. #define ABS(x)  ( (x)<0 ? -(x) : (x) )
  9. #define LEAST(x,y)    ( (x)<(y) ? (x) : (y) )
  10. #define GREATEST(x,y)    ( (x)>(y) ? (x) : (y) )
  11.  
  12.  
  13.  
  14. // This will probably end up being called by LastWolf to generate the tree
  15. // from a level file.
  16. CLine *GenerateBspTree(BspCommandLine *pCommandLine, CLineArray *pLinesToFill, CPointArray *pPointsToFill);
  17.  
  18. // The high-level recursive function to split and generate the BSP.
  19. CLine *GenerateSubTree( CLineArray * );
  20.  
  21. // Does the real work in the BSP generator.  Tries to find the best line out of pLines,
  22. // and splits pLines by that line, creating pLeftSide, and pRightSide.  Returns the Line
  23. // it split everything by.  IMPORTANT:  It assumes pNewLeft and pNewRight are blank when
  24. // passed to it.
  25. CLine *Split_Tree( CLineArray *pLines, CLineArray *pNewLeft, CLineArray *pNewRight );
  26.  
  27. // Tries to find the best line in the array to split everything by.
  28. CLine *BestSplit( CLineArray *pLineList, WORD *pNLeft, WORD *pNRight, WORD *pNSplits );
  29.  
  30. // Returns which side pTestLine is on pMainLine.
  31. SideDir LineSide( CLine *pMainLine, CLine *pTestLine );
  32.  
  33. // Splits pToSplit on pMainLine.  Sets pNewLeft and pNewRight to point to the new Lines.
  34. BOOL SplitLine( CLine *pMainLine, CLine *pToSplit, CLine **pNewLeft, CLine **pNewRight );
  35.  
  36. // Gets the angle between two angles in a certain direction.
  37. Angle DirectionDiff( Angle compass1, Angle compass2, SideDir diffDir );
  38.  
  39. // Just skips any number of comment lines.
  40. void SkipComments( FILE * );
  41.  
  42. // Just fills in normalX and normalY for all of the Lines.
  43. BOOL PrecalculateData( CLineArray *pLineList );
  44.  
  45. // Used for debugging .. checks overlapping vertices, bad tree structure, etc.
  46. BOOL CheckTreeValidity();
  47.  
  48.  
  49.  
  50.